﻿Imports System.Windows.Data
Imports System.IO
Imports System.Windows.Media.Imaging

Public Class ImageConverter
    Implements IValueConverter

    Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
        Dim memStream As New MemoryStream(CType(value, Byte()), False)
        Dim empImage As New BitmapImage()
        empImage.SetSource(memStream)
        Return empImage
    End Function

    Public Function ConvertBack(ByVal value As Object, _
                                ByVal targetType As Type, _
                                ByVal parameter As Object, _
                                ByVal culture As Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
        Throw New NotImplementedException()
    End Function
End Class
